﻿public namespace System.Console
{
	@Native("$System.Console.WriteLine")
	public abstract void WriteLine(string str);
	@Native("$System.Console.WriteLine")
	public abstract void WriteLine();
	@Native("$System.Console.Write")
	public abstract void Write(string str);
	@Native("$System.Console.Write")
	public abstract void Write(num i);	
	@Native("$System.Console.Write")
	public abstract void Write(bool b);		
}

public namespace NSpace
{
	using System.Console;
		
	System.Console.Write("Hallo Neue Welt");
	System.Console.WriteLine();
	
	var lst = ["Torben", "Claudia", "Theo"];
	lst.Push("Helmut");
	
	foreach( var str in lst )
	{
		WriteLine(str);
	}
	WriteLine("============");
	
	public class Container<T>
	{
		public list<T> data = [];
		
		public void Add(T t)
		{
			var object obj = t;
			this.data.Push(t);
		}
	}
	
	var container = new Container<num>();
	container.Add(1234);

	foreach( var num num in container.data )
	{
		Write(num);
		WriteLine(" ===");
	}
	WriteLine("============");
	
	public class ExtContainer<X> : Container<X>
	{
		public void MoreAdd(X x)
		{
			this.Add(x);
		}

		public X Name { get; set; }
				
		public class Item
		{
			public X Value;
		}
		
		public class YItem<Y>
		{
			public X XValue;
			public Y YValue;
		}
	}
	
	var item = new ExtContainer<num>.Item();
	item.Value = 234;
	var item2 = new ExtContainer<string>.Item();
	item2.Value = "Huhu";
	var item3 = new ExtContainer<string>.YItem<num>();
	item3.XValue = "Huhu";
	item3.YValue = 12345;

	Write(item.Value);
	WriteLine("");
	Write(item2.Value);
	WriteLine("");
	Write(item3.XValue);
	WriteLine("");	
	Write(item3.YValue);
	WriteLine("============");

	var container2 = new ExtContainer<string>();
	container2.Name = "Mein Name";
	
	public enum MyEnum
	{
		Torben,
		Claudia
	}
	
	public enum Names : string
	{
		Torben = "Torben Weis",
		Claudia = "Claudia Weis"
	}

	public enum Ids : num
	{
		Torben = 1,
		Claudia = 2
	}	
	
	var Names name = Names.Torben;
	var Ids id = Ids.Claudia;
	var string namestr = Names.Claudia;
	var enm = MyEnum.Claudia;
}